import 'package:tiktokadult/hj_model/home/module_detail_model.dart';

class CollectSectionItemModel {
  CollectSectionItemModel({
    this.id,
    this.sectionName,
    this.sectionCover,
    this.background,
    this.subModuleID,
    this.desc,
    this.originalUserID,
    this.originalUserName,
    this.status,
    this.moduleType,
    this.sort,
    this.createdAt,
    this.updatedAt,
    this.vPlayCount,
    this.likeCount,
    this.commentCount,
    this.collCount,
    this.voteCount,
    this.disVoteCount,
    this.deletedAt,
    this.showType,
    this.type,
    this.linkType,
    this.linkUrl,
    this.isDelete,
    this.updatedAct,
  });

  CollectSectionItemModel.fromJson(dynamic json) {
    id = json['id'];
    sectionName = json['sectionName'];
    sectionCover = json['sectionCover'];
    background = json['background'];
    subModuleID = json['subModuleID'];
    desc = json['desc'];
    originalUserID = json['originalUserID'];
    originalUserName = json['originalUserName'];
    status = json['status'];
    moduleType = json['moduleType'];
    sort = json['sort'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    vPlayCount = json['vPlayCount'];
    likeCount = json['likeCount'];
    commentCount = json['commentCount'];
    collCount = json['collCount'];
    voteCount = json['voteCount'];
    disVoteCount = json['disVoteCount'];
    deletedAt = json['deletedAt'];
    showType = json['showType'];
    type = json['type'];
    linkType = json['linkType'];
    linkUrl = json['linkUrl'];
    isDelete = json['isDelete'];

    updatedAct = json['updatedAct'];
  }
  String? id;
  String? sectionName;
  String? sectionCover;
  String? background;
  String? subModuleID;
  String? desc;
  int? originalUserID;
  String? originalUserName;
  int? status;
  int? moduleType;
  int? sort;
  String? createdAt;
  String? updatedAt;
  int? vPlayCount;
  int? likeCount;
  int? commentCount;
  int? collCount;
  int? voteCount;
  int? disVoteCount;
  String? deletedAt;
  int? showType;
  int? type;
  int? linkType;
  String? linkUrl;
  bool? isDelete;
  String? updatedAct;

  bool isSelected = false;

  CollectSectionItemModel copyWith({
    String? id,
    String? sectionName,
    String? sectionCover,
    String? background,
    String? subModuleID,
    String? desc,
    int? originalUserID,
    String? originalUserName,
    int? status,
    int? moduleType,
    int? sort,
    String? createdAt,
    String? updatedAt,
    int? vPlayCount,
    int? likeCount,
    int? commentCount,
    int? collCount,
    int? voteCount,
    int? disVoteCount,
    String? deletedAt,
    int? showType,
    int? type,
    int? linkType,
    String? linkUrl,
    bool? isDelete,
    dynamic tagIds,
    String? updatedAct,
  }) =>
      CollectSectionItemModel(
        id: id ?? this.id,
        sectionName: sectionName ?? this.sectionName,
        sectionCover: sectionCover ?? this.sectionCover,
        background: background ?? this.background,
        subModuleID: subModuleID ?? this.subModuleID,
        desc: desc ?? this.desc,
        originalUserID: originalUserID ?? this.originalUserID,
        originalUserName: originalUserName ?? this.originalUserName,
        status: status ?? this.status,
        moduleType: moduleType ?? this.moduleType,
        sort: sort ?? this.sort,
        createdAt: createdAt ?? this.createdAt,
        updatedAt: updatedAt ?? this.updatedAt,
        vPlayCount: vPlayCount ?? this.vPlayCount,
        likeCount: likeCount ?? this.likeCount,
        commentCount: commentCount ?? this.commentCount,
        collCount: collCount ?? this.collCount,
        voteCount: voteCount ?? this.voteCount,
        disVoteCount: disVoteCount ?? this.disVoteCount,
        deletedAt: deletedAt ?? this.deletedAt,
        showType: showType ?? this.showType,
        type: type ?? this.type,
        linkType: linkType ?? this.linkType,
        linkUrl: linkUrl ?? this.linkUrl,
        isDelete: isDelete ?? this.isDelete,
        updatedAct: updatedAct ?? this.updatedAct,
      );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['sectionName'] = sectionName;
    map['sectionCover'] = sectionCover;
    map['background'] = background;
    map['subModuleID'] = subModuleID;
    map['desc'] = desc;
    map['originalUserID'] = originalUserID;
    map['originalUserName'] = originalUserName;
    map['status'] = status;
    map['moduleType'] = moduleType;
    map['sort'] = sort;
    map['createdAt'] = createdAt;
    map['updatedAt'] = updatedAt;
    map['vPlayCount'] = vPlayCount;
    map['likeCount'] = likeCount;
    map['commentCount'] = commentCount;
    map['collCount'] = collCount;
    map['voteCount'] = voteCount;
    map['disVoteCount'] = disVoteCount;
    map['deletedAt'] = deletedAt;
    map['showType'] = showType;
    map['type'] = type;
    map['linkType'] = linkType;
    map['linkUrl'] = linkUrl;
    map['isDelete'] = isDelete;
    map['updatedAct'] = updatedAct;
    return map;
  }

  AllSection changeModel() {
    AllSection allSection = AllSection();
    allSection.collected = true;
    allSection.sectionCover = sectionCover;
    allSection.sectionName = sectionName;
    allSection.collCount = collCount;
    allSection.viewCounts = vPlayCount;
    allSection.desc = desc;
    allSection.sectionID = id;
    return allSection;
  }
}
